#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\CDT.h>

const char*CDTName = "CDT.dat";

static CDT_REC srCDTRec;

static int recordNum;
int	inLoadCDTRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(CDT_FILENAME, SIZE_CDT_REC, inRecNumber, (char *) &srCDTRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetCDTRec(void)
{
	return &srCDTRec;

}

int	inSaveCDTRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(CDT_FILENAME, SIZE_CDT_REC, inRecNumber, (char *) &srCDTRec);

	return inRet;
}

int	inGetCDTRecNumber (void)
{
	return recordNum;
}

int	inUpdateCDTRec (void)
{
	int inRet;

	inRet = inSaveConfRec(CDT_FILENAME, SIZE_CDT_REC, recordNum, (char *) &srCDTRec);

	return inRet;
}

void	vdResetCDTRec (void)
{
	memset((void*)&srCDTRec, 0, REC_SIZEOF(srCDTRec));
}

char* szGetPANLo(void)
{
	return srCDTRec.szPANLo;
}

void vdSetPANLo(const char* szPANLo)
{
	strNumCopy(srCDTRec.szPANLo, szPANLo, sizeof(((CDT_REC*)NULL)->szPANLo)-1);
}

char* szGetPANHi(void)
{
	return srCDTRec.szPANHi;
}

void vdSetPANHi(const char* szPANHi)
{
	strNumCopy(srCDTRec.szPANHi, szPANHi, sizeof(((CDT_REC*)NULL)->szPANHi)-1);
}

char* szGetSrvENum(void)
{
	return srCDTRec.szSrvENum;
}

void vdSetSrvENum(const char* szSrvENum)
{
	strNumCopy(srCDTRec.szSrvENum, szSrvENum, sizeof(((CDT_REC*)NULL)->szSrvENum)-1);
}

char* szGetCardAbbrev(void)
{
	return srCDTRec.szCardAbbrev;
}

void vdSetCardAbbrev(const char* szCardAbbrev)
{
	strNumCopy(srCDTRec.szCardAbbrev, szCardAbbrev, sizeof(((CDT_REC*)NULL)->szCardAbbrev)-1);
}

char* szGetCardLabel(void)
{
	return srCDTRec.szCardLabel;
}

void vdSetCardLabel(const char* szCardLabel)
{
	strNumCopy(srCDTRec.szCardLabel, szCardLabel, sizeof(((CDT_REC*)NULL)->szCardLabel)-1);
}

char* szGetTracksRequired(void)
{
	return srCDTRec.szTracksRequired;
}

void vdSetTracksRequired(const char* szTracksRequired)
{
	strNumCopy(srCDTRec.szTracksRequired, szTracksRequired, sizeof(((CDT_REC*)NULL)->szTracksRequired)-1);
}

char* szGetCDTStrDummy(void)
{
	return srCDTRec.szCDTStrDummy;
}

void vdSetCDTStrDummy(const char* szCDTStrDummy)
{
	strNumCopy(srCDTRec.szCDTStrDummy, szCDTStrDummy, sizeof(((CDT_REC*)NULL)->szCDTStrDummy)-1);
}

short inGetType(void)
{
	return srCDTRec.inType;
}

void vdSetType(short inType)
{
	srCDTRec.inType = inType;
}

short inGetHostIndex(void)
{
	return srCDTRec.inHostIndex;
}

void vdSetHostIndex(short inHostIndex)
{
	srCDTRec.inHostIndex = inHostIndex;
}

short inGetHostGroupID(void)
{
	return srCDTRec.inHostGroupID;
}

void vdSetHostGroupID(short inHostGroupID)
{
	srCDTRec.inHostGroupID = inHostGroupID;
}

short inGetMinPANDigit(void)
{
	return srCDTRec.inMinPANDigit;
}

void vdSetMinPANDigit(short inMinPANDigit)
{
	srCDTRec.inMinPANDigit = inMinPANDigit;
}

short inGetMaxPANDigit(void)
{
	return srCDTRec.inMaxPANDigit;
}

void vdSetMaxPANDigit(short inMaxPANDigit)
{
	srCDTRec.inMaxPANDigit = inMaxPANDigit;
}

short inGetAVS(void)
{
	return srCDTRec.inAVS;
}

void vdSetAVS(short inAVS)
{
	srCDTRec.inAVS = inAVS;
}

short inGetIssuerNum(void)
{
	return srCDTRec.inIssuerNum;
}

void vdSetIssuerNum(short inIssuerNum)
{
	srCDTRec.inIssuerNum = inIssuerNum;
}

short inGetImamCDTIndex(void)
{
	return srCDTRec.inImamCDTIndex;
}

void vdSetImamCDTIndex(short inImamCDTIndex)
{
	srCDTRec.inImamCDTIndex = inImamCDTIndex;
}

short inGetFPSType(void)
{
	return srCDTRec.inFPSType;
}

void vdSetFPSType(short inFPSType)
{
	srCDTRec.inFPSType = inFPSType;
}

short inGetCVV_II(void)
{
	return srCDTRec.inCVV_II;
}

void vdSetCVV_II(short inCVV_II)
{
	srCDTRec.inCVV_II = inCVV_II;
}

short inGetPaymentIndex(void)
{
	return srCDTRec.inPaymentIndex;
}

void vdSetPaymentIndex(short inPaymentIndex)
{
	srCDTRec.inPaymentIndex = inPaymentIndex;
}

short inGetCDTCustomInt(void)
{
	return srCDTRec.inCDTCustomInt;
}

void vdSetCDTCustomInt(short inCDTCustomInt)
{
	srCDTRec.inCDTCustomInt = inCDTCustomInt;
}

short inGetStatus(void)
{
	return srCDTRec.inStatus;
}

void vdSetStatus(short inStatus)
{
	srCDTRec.inStatus = inStatus;
}

long lnGetTipDiscount(void)
{
	return srCDTRec.lnTipDiscount;
}

void vdSetTipDiscount(long lnTipDiscount)
{
	srCDTRec.lnTipDiscount = lnTipDiscount;
}

long lnGetFloorLimitAmount(void)
{
	return srCDTRec.lnFloorLimitAmount;
}

void vdSetFloorLimitAmount(long lnFloorLimitAmount)
{
	srCDTRec.lnFloorLimitAmount = lnFloorLimitAmount;
}

VS_BOOL fGetCDTCustomBit1(void)
{
	return srCDTRec.fCDTCustomBit1;
}

void vdSetCDTCustomBit1(VS_BOOL fCDTCustomBit1)
{
	srCDTRec.fCDTCustomBit1 = fCDTCustomBit1;
}

VS_BOOL fGetCDTCustomBit2(void)
{
	return srCDTRec.fCDTCustomBit2;
}

void vdSetCDTCustomBit2(VS_BOOL fCDTCustomBit2)
{
	srCDTRec.fCDTCustomBit2 = fCDTCustomBit2;
}

VS_BOOL fGetCDTCustomBit3(void)
{
	return srCDTRec.fCDTCustomBit3;
}

void vdSetCDTCustomBit3(VS_BOOL fCDTCustomBit3)
{
	srCDTRec.fCDTCustomBit3 = fCDTCustomBit3;
}

VS_BOOL fGetCDTCustomBit4(void)
{
	return srCDTRec.fCDTCustomBit4;
}

void vdSetCDTCustomBit4(VS_BOOL fCDTCustomBit4)
{
	srCDTRec.fCDTCustomBit4 = fCDTCustomBit4;
}

VS_BOOL fGetCheckProdCode(void)
{
	return srCDTRec.fCheckProdCode;
}

void vdSetCheckProdCode(VS_BOOL fCheckProdCode)
{
	srCDTRec.fCheckProdCode = fCheckProdCode;
}

VS_BOOL fGetChkLuhn(void)
{
	return srCDTRec.fChkLuhn;
}

void vdSetChkLuhn(VS_BOOL fChkLuhn)
{
	srCDTRec.fChkLuhn = fChkLuhn;
}

VS_BOOL fGetExpDtReqd(void)
{
	return srCDTRec.fExpDtReqd;
}

void vdSetExpDtReqd(VS_BOOL fExpDtReqd)
{
	srCDTRec.fExpDtReqd = fExpDtReqd;
}

VS_BOOL fGetManEntry(void)
{
	return srCDTRec.fManEntry;
}

void vdSetManEntry(VS_BOOL fManEntry)
{
	srCDTRec.fManEntry = fManEntry;
}

VS_BOOL fGetAllowMultiCurr(void)
{
	return srCDTRec.fAllowMultiCurr;
}

void vdSetAllowMultiCurr(VS_BOOL fAllowMultiCurr)
{
	srCDTRec.fAllowMultiCurr = fAllowMultiCurr;
}

VS_BOOL fGetSignLine(void)
{
	return srCDTRec.fSignLine;
}

void vdSetSignLine(VS_BOOL fSignLine)
{
	srCDTRec.fSignLine = fSignLine;
}

VS_BOOL fGetCardPresent(void)
{
	return srCDTRec.fCardPresent;
}

void vdSetCardPresent(VS_BOOL fCardPresent)
{
	srCDTRec.fCardPresent = fCardPresent;
}

VS_BOOL fGetPinpadRequired(void)
{
	return srCDTRec.fPinpadRequired;
}

void vdSetPinpadRequired(VS_BOOL fPinpadRequired)
{
	srCDTRec.fPinpadRequired = fPinpadRequired;
}

VS_BOOL fGetPrntrRequired(void)
{
	return srCDTRec.fPrntrRequired;
}

void vdSetPrntrRequired(VS_BOOL fPrntrRequired)
{
	srCDTRec.fPrntrRequired = fPrntrRequired;
}

VS_BOOL fGetChkServiceCode(void)
{
	return srCDTRec.fChkServiceCode;
}

void vdSetChkServiceCode(VS_BOOL fChkServiceCode)
{
	srCDTRec.fChkServiceCode = fChkServiceCode;
}

VS_BOOL fGetImamSelectAcc(void)
{
	return srCDTRec.fImamSelectAcc;
}

void vdSetImamSelectAcc(VS_BOOL fImamSelectAcc)
{
	srCDTRec.fImamSelectAcc = fImamSelectAcc;
}

VS_BOOL fGetImamPrivateLabel(void)
{
	return srCDTRec.fImamPrivateLabel;
}

void vdSetImamPrivateLabel(VS_BOOL fImamPrivateLabel)
{
	srCDTRec.fImamPrivateLabel = fImamPrivateLabel;
}

VS_BOOL fGetImamSwipe4DBC(void)
{
	return srCDTRec.fImamSwipe4DBC;
}

void vdSetImamSwipe4DBC(VS_BOOL fImamSwipe4DBC)
{
	srCDTRec.fImamSwipe4DBC = fImamSwipe4DBC;
}

VS_BOOL fGetImamManual4DBC(void)
{
	return srCDTRec.fImamManual4DBC;
}

void vdSetImamManual4DBC(VS_BOOL fImamManual4DBC)
{
	srCDTRec.fImamManual4DBC = fImamManual4DBC;
}

VS_BOOL fGetCDTSale(void)
{
	return srCDTRec.fCDTSale;
}

void vdSetCDTSale(VS_BOOL fCDTSale)
{
	srCDTRec.fCDTSale = fCDTSale;
}

VS_BOOL fGetCDTCardVer(void)
{
	return srCDTRec.fCDTCardVer;
}

void vdSetCDTCardVer(VS_BOOL fCDTCardVer)
{
	srCDTRec.fCDTCardVer = fCDTCardVer;
}

VS_BOOL fGetCDTAuthOnly(void)
{
	return srCDTRec.fCDTAuthOnly;
}

void vdSetCDTAuthOnly(VS_BOOL fCDTAuthOnly)
{
	srCDTRec.fCDTAuthOnly = fCDTAuthOnly;
}

VS_BOOL fGetCDTNormPreAuth(void)
{
	return srCDTRec.fCDTNormPreAuth;
}

void vdSetCDTNormPreAuth(VS_BOOL fCDTNormPreAuth)
{
	srCDTRec.fCDTNormPreAuth = fCDTNormPreAuth;
}

VS_BOOL fGetCDTOffline(void)
{
	return srCDTRec.fCDTOffline;
}

void vdSetCDTOffline(VS_BOOL fCDTOffline)
{
	srCDTRec.fCDTOffline = fCDTOffline;
}

VS_BOOL fGetCDTRefund(void)
{
	return srCDTRec.fCDTRefund;
}

void vdSetCDTRefund(VS_BOOL fCDTRefund)
{
	srCDTRec.fCDTRefund = fCDTRefund;
}

VS_BOOL fGetCDTTipAdjust(void)
{
	return srCDTRec.fCDTTipAdjust;
}

void vdSetCDTTipAdjust(VS_BOOL fCDTTipAdjust)
{
	srCDTRec.fCDTTipAdjust = fCDTTipAdjust;
}

VS_BOOL fGetCDTPreAuth(void)
{
	return srCDTRec.fCDTPreAuth;
}

void vdSetCDTPreAuth(VS_BOOL fCDTPreAuth)
{
	srCDTRec.fCDTPreAuth = fCDTPreAuth;
}

VS_BOOL fGetCDTPreComp(void)
{
	return srCDTRec.fCDTPreComp;
}

void vdSetCDTPreComp(VS_BOOL fCDTPreComp)
{
	srCDTRec.fCDTPreComp = fCDTPreComp;
}

